//package com.zscat.mall.portal.service.impl;
//
//import com.zscat.mall.portal.entity.MemberBrandAttention;
//import com.zscat.mall.portal.repository.MemberBrandAttentionRepository;
//import com.zscat.mall.portal.service.MemberAttentionService;
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource;
//import java.util.List;
//
///**
// * 会员关注Service实现类
// * Created by zscat on 2018/8/2.
// */
//@Service
//public class MemberAttentionServiceImpl implements MemberAttentionService {
//    @Resource
//    private MemberBrandAttentionRepository memberBrandAttentionRepository;
//
//    @Override
//    public int add(MemberBrandAttention memberBrandAttention) {
//        int count = 0;
//        MemberBrandAttention findAttention = memberBrandAttentionRepository.findByMemberIdAndBrandId(memberBrandAttention.getMemberId(), memberBrandAttention.getBrandId());
//        if (findAttention == null) {
//            memberBrandAttentionRepository.save(memberBrandAttention);
//            count = 1;
//        }
//        return count;
//    }
//
//    @Override
//    public int delete(Long memberId, Long brandId) {
//        return memberBrandAttentionRepository.deleteByMemberIdAndBrandId(memberId, brandId);
//    }
//
//    @Override
//    public List<MemberBrandAttention> list(Long memberId) {
//        return memberBrandAttentionRepository.findByMemberId(memberId);
//    }
//}
